<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="../assets/layui/css/layui.css">
    <link rel="stylesheet" href="../assets/lib/cropper/cropper.css" />
    <link rel="stylesheet" href="../assets/css/user_avatar.css">

</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">编辑用户</div>
        <div class="layui-card-body">
            <!-- 添加用户表单 -->
            <form class="layui-form" lay-filter='editForm' action="">
                <!-- 用户名 -->
                <input type="hidden" name="id">
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名</label>
                    <div class="layui-input-block">
                        <input type="text" name="username" required lay-verify="required" placeholder="请输入用户名"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!-- 昵称 -->
                <div class="layui-form-item">
                    <label class="layui-form-label">昵称</label>
                    <div class="layui-input-block">
                        <input type="text" name="nickname" required lay-verify="required" placeholder="请输入昵称"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!-- 邮箱 -->
                <div class="layui-form-item">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-block">
                        <input type="text" name="email" required lay-verify="required" placeholder="请输入邮箱"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!-- 第一行的图片裁剪和预览区域 -->
                <div class="row1">
                    <!-- 图片裁剪区域 -->
                    <div class="cropper-box">
                        <!-- 这个 img 标签很重要，将来会把它初始化为裁剪区域 -->
                        <img id="image" src="../assets/images/sample.jpg" />
                    </div>
                    <!-- 图片的预览区域 -->
                    <div class="preview-box">
                        <div>
                            <!-- 宽高为 100px 的预览区域 -->
                            <div class="img-preview w100"></div>
                            <p class="size">100 x 100</p>
                        </div>
                        <div>
                            <!-- 宽高为 50px 的预览区域 -->
                            <div class="img-preview w50"></div>
                            <p class="size">50 x 50</p>
                        </div>
                    </div>
                </div>
                <!-- 第二行的按钮区域 -->
                <div class="row2">
                    <!-- 文件选择控件 -->
                    <input type="file" id="file" accept="image/png,image/jpeg" name="upload" style="display: none;" />
                    <div class="layui-input-block">
                        <button class="layui-btn" id="upload">选择头像</button>
                        <button class="layui-btn" lay-submit lay-filter="*" id="sub">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary" id="rest_edit">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <!-- 导入jQuery -->
    <script type="text/javascript" src="../assets/lib/jquery.js"></script>
    <!-- 导入layui -->
    <script type="text/javascript" src="../assets/layui/layui.all.js"></script>
    <!-- 图片裁剪 -->
    <script src="../assets/lib/cropper/Cropper.js"></script>
    <script src="../assets/lib/cropper/jquery-cropper.js"></script>
    <!-- 导入模板引擎 -->
    <script src="../assets/template-web.js"></script>
    <!-- 导入baseAPI -->
    <script src="../assets/js/baseAPI.js"></script>
    <!-- 导入 -->
    <script src="../assets/js/user_edit.js"></script>
</body>

</html>